import request from '@/utils/request'

const apiUrl = '/api/v1/farm/'

export function list() {
  return request({
    url: apiUrl + 'list',
    method: 'get'
  })
}

export function info(id) {
  return request({
    url: apiUrl + id,
    method: 'get'
  })
}

export function add(parameter) {
  return request({
    url: apiUrl,
    method: 'post',
    data: parameter
  })
}

export function edit(parameter) {
  return request({
    url: apiUrl,
    method: 'put',
    data: parameter
  })
}

export function del(id) {
  return request({
    url: apiUrl + id,
    method: 'delete',
  })
}

export function delBatch(ids) {
  return request({
    url: apiUrl + 'ids/' + ids,
    method: 'delete'
  })
}
